package com.project.purchase.Service.Imp;

import com.project.purchase.Service.IUser;
import com.project.purchase.entity.User;
import com.project.purchase.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author VX5
 * @Title: QZP
 * @ProjectName purchase
 * @Description: TODO
 * @date ${DAT}15:39
 */
@Service
public class UserImp implements IUser {
    @Autowired
    UserMapper userMapper;

    @Override
    public void addUser(User user) {
        userMapper.insertSelective(user);
    }

    @Override
    public void deletByLoginName(String name) {
        userMapper.deleteByPrimaryKey(name);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public User getUserByName(String name) {
        return userMapper.selectByPrimaryKey(name);
    }
}
